import 'virtual:uno.css'

import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import { createPinia } from 'pinia'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
// 导入中文语言包
import zhCn from 'element-plus/es/locale/lang/zh-cn'

// 引入主题服务
import themeService, { provideThemeService } from './utils/themeService'

import './assets/main.css'

/* add fontawesome core */
import { library } from '@fortawesome/fontawesome-svg-core'

/* import all the icons in Free Solid, Free Regular, and Brands styles */
import { fas } from '@fortawesome/free-solid-svg-icons'
import { far } from '@fortawesome/free-regular-svg-icons'
import { fab } from '@fortawesome/free-brands-svg-icons'

library.add(fas, far, fab)
const pinia = createPinia()
const app = createApp(App)

// 提供主题服务
provideThemeService(app)

app.use(router)
app.use(pinia)
app.use(ElementPlus, {
  locale: zhCn,
})
app.mount('#app')

// 导出主题服务，可在应用的其他地方使用
export { themeService }
